﻿//全选/反选
function CheckboxChoose(choosed) {
    var elementOnes = document.form1.elements;
    var boolAll = true;
    var controlAll;

    for (var i = 0; i < elementOnes.length; i++) {
        if (choosed.id.indexOf('CheckAll') != -1) {
            elementOnes[i].checked = choosed.checked;
            controlAll = elementOnes[i];
        }
        else if (choosed.id.indexOf('DeleteThis') != -1) {
            if (elementOnes[i].id.indexOf('CheckAll') != -1) {
                controlAll = elementOnes[i];
                controlAll.checked = true;
            }
            if (elementOnes[i].checked == false) {
                boolAll = false;
            }
        }
    }
    controlAll.checked = boolAll;
}